/*
 * Copyright (c) 2006, 2021, webrx.cn All rights reserved.
 *
 */
package cn.webrx;

/**
 * <p>Project: javaseapp - Arr1
 * <p>Powered by webrx On 2021-08-04 09:22:31
 * <p>Created by IntelliJ IDEA
 *
 * @author webrx [webrx@126.com]
 * @version 1.0
 * @since 16
 */
public class Arr1 {
    public static void main(String[] args) {
        int a[];
        int[] c;
        String[] ns = {"a", "b", "c"};
        //推荐
        String[] s2 = new String[]{"java", "php"};
        double[] ds = new double[6];//下标是0 - 5
        System.out.println(ds[0]);//0.0
        System.out.println(ds[5]);//0.0
        System.out.println(ds.length);//6
        //System.out.println(ds[6]);//有异常，运行时报错，下标越界

        int[] nums = {1, 2, 3};
        System.out.println(nums.length); //属性是返回数组元素的个数
        System.out.println(nums[1]);
    }
}
